<template>
	<view class="page">
		<!-- 视频播放 -->
		<view class="player">
			<video :src="trailerInfo.trailer" :poster="trailerInfo.poster" class="movie" controls></video>
		</view>

		<!-- 影片信息 -->
		<view class="movie-info">
			<image :src="trailerInfo.cover" class="cover"></image>

			<view class="movie-desc">
				<view class="title">
					{{trailerInfo.name}}
				</view>
				<view class="basic-info">
					{{trailerInfo.bascInfo}}
				</view>
				<view class="basic-info">
					{{trailerInfo.originalName}}
				</view>
				<view class="basic-info">
					{{trailerInfo.totalTime}}
				</view>
				<view class="basic-info">
					{{trailerInfo.releaseDate}}
				</view>

				<view class="score-block">
					<view class="big-score">
						<view class="score-words">
							<text>综合评分：</text>
						</view>
						<view class="movie-score">
							{{trailerInfo.score}}
						</view>
					</view>

					<view class="score-starts">
						<block v-if="trailerInfo.score">
							<trailerStars :innerScore="trailerInfo.score" :showNum="0"></trailerStars>
						</block>
						
						<view class="prise-counts">
							{{trailerInfo.prisedCounts}} 人点赞
						</view>
					</view>
				</view>
				
				<!-- 剧情介绍 -->
				<view class="plots-block">
					<view class="plots-title">
						剧情介绍
					</view>
					
					<view class="plots-desc">
						{{trailerInfo.plotDesc}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import trailerStars from "../../components/trailerStars.vue"
	export default {
		components: {
			trailerStars
		},
		data() {
			return {
				// 根据id获取详细的信息
				trailerInfo: {
					trailer: "../../static/video/superDetail.mp4",
					poster: "https://t11.baidu.com/it/u=2152164906,2956988682&fm=58&app=83&f=JPEG?w=200&h=266",
					cover: "https://t11.baidu.com/it/u=2152164906,2956988682&fm=58&app=83&f=JPEG?w=200&h=266",
					name: "超级英雄",
					bascInfo: "原名：Aqueare",
					originalName: "2021 / 美国 / 科幻 / 超级英雄",
					totalTime: "影片时长：111分钟（中国大陆）",
					releaseDate: "上映时间：2021-11-11（中国大陆）",
					score: "8.2",
					prisedCounts: "2000"
				}
			}
		},
		onLoad(params) {
			if (params) {
				console.log(params.trailerId);
			}
			// 通过api修改导航栏
			uni.setNavigationBarColor({
				frontColor: "#fff",
				backgroundColor: "#000"
			})
		}
	}
</script>

<style lang="scss" scoped>
	@import "./moviedetail.scss";
</style>
